<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<fieldset>
	<legend>
		<strong>Group Information</strong>
		hello, <%=request.getSession().getAttribute("username")%>
	</legend>
	<div id="content_main">
		<form:form id="form" name="form_group" method="post"
			action="/ChitFund/user/saveGroup.htm">
			<table>
				<tr>
					<td><input type="hidden" name="groupId"
						value="${group.groupId}" /></td>
				</tr>
				<tr>
					<td><form:label path="groupCode">groupCode</form:label></td>
					<td><form:input path="groupCode" value="${group.groupCode}" /></td>
				</tr>
				<tr>
					<td><form:label path="groupName">groupName</form:label></td>
					<td><form:input path="groupName" value="${group.groupName}" /></td>
				</tr>
				<tr>
					<td><form:label path="branch.branchId">Branch</form:label></td>
					<td><select name="branch.branchId">
							<c:forEach var="branch" items="${branches}">
								<option value="${branch.branchId}">
									<c:out value="${branch.branchName}" />
								</option>
							</c:forEach>
					</select></td>
				</tr>
				<tr>
					<td><form:label path="days">Days</form:label></td>
					<td><form:input path="days" value="${group.days}" /></td>
				</tr>
				<tr>
					<td><form:label path="amount">Amount</form:label></td>
					<td><form:input path="amount" value="${group.amount}" /></td>
				</tr>


			</table>
			<div class="form-btn">
				<input type="submit" name="Save" id="Save" value="Save"
					class="btn btn-large" /> <input type="reset" name="Clear"
					id="Clear" value="Reset" class="btn btn-large" />

			</div>
		</form:form>
	</div>
	<div class="span11">

		<h3>groups</h3>

		<c:if test="${!empty groupList}">
			<table id="tblData"
				class="table table-bordered table-striped table-hover">
				<thead>
					<tr>
						<th>groupCode</th>
						<th>groupName</th>
						<th>Days</th>
						<th>Amount</th>
					</tr>
				</thead>
				<tbody>

					<c:forEach items="${groupList}" var="group">
						<tr>
							<td>${group.groupCode}</td>
							<td>${group.groupName}</td>
							<td>${group.days}</td>
							<td>${group.amount}</td>
							<td><a href="/ChitFund/deleteGroup.htm?id=${group.groupId}">delete</a></td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</c:if>

		<c:if test="${empty groupList }">
			<c:out value="No group">
			</c:out>
		</c:if>
	</div>
</fieldset>